﻿using System;
using System.ComponentModel.DataAnnotations;
using PortalWeb.I18N;

namespace PortalWeb.Models.Cms
{
    public class CommonModelViewModel
    {
        public CommonModelViewModel()
        {
        }

        public int Id { get; set; }

        /// <summary>
        /// 标题
        /// </summary>
        [Display(ResourceType = typeof (Resources), Name = "Title")]
        [Required]
        [StringLength(255, ErrorMessage = "必须少于{0}个字")]
        public string Title { get; set; }

        [Display(ResourceType = typeof (Resources), Name = "Category")]
        public int CategoryId { get; set; }

        [Display(ResourceType = typeof (Resources), Name = "CategoryName")]
        public string CategoryName { get; set; }

        [Display(ResourceType = typeof (Resources), Name = "Author")]
        public string Author { get; set; }

        [Display(ResourceType = typeof (Resources), Name = "Source")]
        public string Source { get; set; }

        /// <summary>
        /// 首页图片
        /// </summary>
        [Display(Name = "首页图片")]
        [StringLength(255, ErrorMessage = "必须少于{0}个字符")]
        public string DefaultPicUrl { get; set; }

        [Display(Name = "录入者")]
        [StringLength(50, ErrorMessage = "必须少于{0}个字")]
        public string Inputer { get; set; }

        /// <summary>
        /// 点击
        /// </summary>
        [Display(Name = "点击")]
        public int Hits { get; set; }

        /// <summary>
        /// 发布日期
        /// </summary>
        [Display(ResourceType = typeof (Resources), Name = "ReleaseDate")]
        public DateTime ReleaseDate { get; set; }

        [Display(ResourceType = typeof (Resources), Name = "Status")]
        public int Status { get; set; }
    }
}